package cn.tedu.lucky.draw.user.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.Arrays;
import java.util.List;

@RestController
public class TestController {

    @GetMapping("/test")
    public Mono<String> test(){
        return Mono.justOrEmpty(null);
    }

    @GetMapping("/test-fluxJust")
    public Flux<String> fluxJust(){
//        "常老师","传奇老师","伟超老师"
        List<String> list = Arrays.asList("常老师", "传奇老师", "伟超老师");
        return Flux.fromIterable(list);
    }

    @GetMapping("/test-empty")
    public Flux<String> fluxEmpty(){
        return Flux.empty();
    }
}
